{"ast":null,"code":"import { SHOW_CHILD } from './commonUtil';\nexport function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {\n  var valueSet = new Set(pathKeys);\n  var keyPathEntities = getKeyPathEntities();\n  return pathKeys.filter(function (key) {\n    var entity = keyPathEntities[key];\n    var parent = entity ? entity.parent : null;\n    var children = entity ? entity.children : null;\n    return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {\n      return child.key && valueSet.has(child.key);\n    })) : !(parent && !parent.node.disabled && valueSet.has(parent.key));\n  });\n}\nexport function toPathOptions(valueCells, options, fieldNames) {\n  var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n  var currentList = options;\n  var valueOptions = [];\n  var _loop = function _loop(i) {\n    var _currentList, _currentList2, _foundOption$fieldNam;\n    var valueCell = valueCells[i];\n    var foundIndex = (_currentList = currentList) === null || _currentList === void 0 ? void 0 : _currentList.findIndex(function (option) {\n      var val = option[fieldNames.value];\n      return stringMode ? String(val) === String(valueCell) : val === valueCell;\n    });\n    var foundOption = foundIndex !== -1 ? (_currentList2 = currentList) === null || _currentList2 === void 0 ? void 0 : _currentList2[foundIndex] : null;\n    valueOptions.push({\n      value: (_foundOption$fieldNam = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _foundOption$fieldNam !== void 0 ? _foundOption$fieldNam : valueCell,\n      index: foundIndex,\n      option: foundOption\n    });\n    currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];\n  };\n  for (var i = 0; i < valueCells.length; i += 1) {\n    _loop(i);\n  }\n  return valueOptions;\n}","map":{"version":3,"names":["SHOW_CHILD","formatStrategyValues","pathKeys","getKeyPathEntities","showCheckedStrategy","valueSet","Set","keyPathEntities","filter","key","entity","parent","children","some","child","has","node","disabled","toPathOptions","valueCells","options","fieldNames","stringMode","arguments","length","undefined","currentList","valueOptions","_loop","i","_currentList","_currentList2","_foundOption$fieldNam","valueCell","foundIndex","findIndex","option","val","value","String","foundOption","push","index"],"sources":["/data/messenger.client/node_modules/rc-cascader/es/utils/treeUtil.js"],"sourcesContent":["import { SHOW_CHILD } from './commonUtil';\nexport function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {\n  var valueSet = new Set(pathKeys);\n  var keyPathEntities = getKeyPathEntities();\n  return pathKeys.filter(function (key) {\n    var entity = keyPathEntities[key];\n    var parent = entity ? entity.parent : null;\n    var children = entity ? entity.children : null;\n    return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {\n      return child.key && valueSet.has(child.key);\n    })) : !(parent && !parent.node.disabled && valueSet.has(parent.key));\n  });\n}\nexport function toPathOptions(valueCells, options, fieldNames) {\n  var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n  var currentList = options;\n  var valueOptions = [];\n  var _loop = function _loop(i) {\n    var _currentList, _currentList2, _foundOption$fieldNam;\n    var valueCell = valueCells[i];\n    var foundIndex = (_currentList = currentList) === null || _currentList === void 0 ? void 0 : _currentList.findIndex(function (option) {\n      var val = option[fieldNames.value];\n      return stringMode ? String(val) === String(valueCell) : val === valueCell;\n    });\n    var foundOption = foundIndex !== -1 ? (_currentList2 = currentList) === null || _currentList2 === void 0 ? void 0 : _currentList2[foundIndex] : null;\n    valueOptions.push({\n      value: (_foundOption$fieldNam = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _foundOption$fieldNam !== void 0 ? _foundOption$fieldNam : valueCell,\n      index: foundIndex,\n      option: foundOption\n    });\n    currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];\n  };\n  for (var i = 0; i < valueCells.length; i += 1) {\n    _loop(i);\n  }\n  return valueOptions;\n}"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,OAAO,SAASC,oBAAoB,CAACC,QAAQ,EAAEC,kBAAkB,EAAEC,mBAAmB,EAAE;EACtF,IAAIC,QAAQ,GAAG,IAAIC,GAAG,CAACJ,QAAQ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